import 'package:bxultimate/app/theme/gaps.dart';
import 'package:bxultimate/resources/assets.dart';
import 'package:bxultimate/widgets/mk_load_image.dart';
import 'package:bxultimate/widgets/mk_page.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';

import 'controller.dart';

class ScanLoginWebPage extends StatefulWidget {
  const ScanLoginWebPage({Key? key}) : super(key: key);

  @override
  State<ScanLoginWebPage> createState() => _ScanLoginWebPageState();
}

class _ScanLoginWebPageState extends State<ScanLoginWebPage> {
  final controller = Get.find<ScanLoginWebController>();
  final state = Get.find<ScanLoginWebController>().state;

  @override
  Widget build(BuildContext context) {
    return MkPage(
        child: Scaffold(
      backgroundColor: Colors.transparent,
      appBar: TDNavBar(
        backgroundColor: Colors.transparent,
        title: '登录网页版',
      ),
      body: Center(
        child: Container(
          height: double.infinity,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              MkLoadImage(
                Assets.imagesIcon,
                width: 80,
              ),
              Gaps.vGap16,
              Text('登录网页版'),
              Gaps.vGap32,
              Gaps.vGap32,
              Gaps.vGap32,
              Gaps.vGap32,
              TDButton(
                text: '确认登录',
                theme: TDButtonTheme.primary,
                isBlock: true,
                onTap: controller.confirm,
              ),
              Gaps.vGap24,
              TDButton(
                text: '取消',
                theme: TDButtonTheme.light,
                isBlock: true,
                onTap: () {
                  Get.back();
                },
              )
            ],
          ),
        ),
      ),
    ));
  }

  @override
  void dispose() {
    Get.delete<ScanLoginWebController>();
    super.dispose();
  }
}
